<?php

namespace app\data\model;

use think\admin\Model;

class ActRegion extends Model
{
    protected $table = 'system_region';

    public function getFullNameArr()
    {
        $arr = [];
        $arr[] = $this->region_name;
        if ($this->parent_id) {
            $parent = self::where('id', $this->parent_id)->find();
            if (empty($parent)) {
                return $arr;
            } else {
                $arr = array_merge($parent->getFullNameArr(), $arr);
            }
        }
        return $arr;

    }
}